import baiduDemo.BaiduDemo;
import faceService.AddFace;
import faceService.CreatePerson;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/10/23.
 */
public class verifyRegister {
    public static void main(String[] args) throws Exception {
        CreatePerson createPerson = new CreatePerson();
        AddFace addFace = new AddFace();
        BaiduDemo baiduDemo = new BaiduDemo();
        List<String> group = new ArrayList<String>();
        group.add("testOne");

        String filePath = "C:\\Users\\Administrator\\Desktop\\facePic";
        File root = new File(filePath);
        File[] files = root.listFiles();
        for (File file : files) {
            if (file.isDirectory()) {
                File[] picFiles = file.listFiles();
                String name = file.getName();
                int i = 0;
                for (File picFile : picFiles) {
                    if (i == 0) {
                        createPerson.createPerson(name, name, picFile.getAbsolutePath());
                    } else {
                        addFace.addFaceImg(name, picFile.getAbsolutePath(), name + i);
                    }
                    baiduDemo.registPerson(picFile.getAbsolutePath(), name, group);
                    i++;
                }
            }
        }
    }
}
